﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.OracleClient;
using System.Data;

namespace Common.Data.Repository.Enum
{
    public class DataMaper
    {
        public static OracleType Map(DataType type)
        {
            OracleType result = default(OracleType);
            switch (type)
            {
                case DataType.BFile:
                    result = OracleType.BFile;
                    break;
                case DataType.Blob:
                    result = OracleType.Blob;
                    break;
                case DataType.Char:
                    result = OracleType.Char;
                    break;
                case DataType.Clob:
                    result = OracleType.Clob;
                    break;
                case DataType.Cursor:
                    result = OracleType.Cursor;
                    break;
                case DataType.DateTime:
                    result = OracleType.DateTime;
                    break;
                case DataType.IntervalDayToSecond:
                    result = OracleType.IntervalDayToSecond;
                    break;
                case DataType.IntervalYearToMonth:
                    result = OracleType.IntervalYearToMonth;
                    break;
                case DataType.LongRaw:
                    result = OracleType.LongRaw;
                    break;
                case DataType.LongVarChar:
                    result = OracleType.LongVarChar;
                    break;
                case DataType.NChar:
                    result = OracleType.NChar;
                    break;
                case DataType.NClob:
                    result = OracleType.NClob;
                    break;
                case DataType.Number:
                    result = OracleType.Number;
                    break;
                case DataType.NVarChar:
                    result = OracleType.NVarChar;
                    break;
                case DataType.Raw:
                    result = OracleType.Raw;
                    break;
                case DataType.RowId:
                    result = OracleType.RowId;
                    break;
                case DataType.Timestamp:
                    result = OracleType.Timestamp;
                    break;
                case DataType.TimestampLocal:
                    result = OracleType.TimestampLocal;
                    break;
                case DataType.TimestampWithTZ:
                    result = OracleType.TimestampWithTZ;
                    break;
                case DataType.VarChar:
                    result = OracleType.VarChar;
                    break;
                case DataType.Byte:
                    result = OracleType.Byte;
                    break;
                case DataType.UInt16:
                    result = OracleType.UInt16;
                    break;
                case DataType.UInt32:
                    result = OracleType.UInt32;
                    break;
                case DataType.SByte:
                    result = OracleType.SByte;
                    break;
                case DataType.Int16:
                    result = OracleType.Int16;
                    break;
                case DataType.Int32:
                    result = OracleType.Int32;
                    break;
                case DataType.Float:
                    result = OracleType.Float;
                    break;
                case DataType.Double:
                    result = OracleType.Double;
                    break;
            }
            return result;
        }

        public static ParameterDirection Map(DataDirection direction)
        {
            ParameterDirection result = default(ParameterDirection);
            switch (direction)
            {
                case DataDirection.Input:
                    result = ParameterDirection.Input;
                    break;
                case DataDirection.Output:
                    result = ParameterDirection.Output;
                    break;
                case DataDirection.InputOutput:
                    result = ParameterDirection.InputOutput;
                    break;
                case DataDirection.ReturnValue:
                    result = ParameterDirection.ReturnValue;
                    break;
            }
            return result;
        }
    }
}